package com.woniu.adminservice.controller;

import com.woniu.adminservice.commeon.CommonResult;
import com.woniu.adminservice.service.GoodsDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Auther: huangjing  <br/>
 * Date: 2020/3/24$:17:23$  <br/>
 * Description:
 */
@Controller
@RequestMapping("/goodsData")
public class GoodsDataController {
    @Autowired
    GoodsDataService goodsDataService;
    @GetMapping("/list")
    @ResponseBody
    public CommonResult list(){
        List goodsInfo = null;
        try {
            goodsInfo= goodsDataService.selectGoodsInfo();
        }catch (Exception e){
            CommonResult.failed("查询失败");
        }

        return CommonResult.success(goodsInfo);
    }
}